package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.DingtalkDutyTimesDao;
import cn.topevery.garden.entity.po.DingtalkDutyTimes;
import cn.topevery.garden.entity.query.DingtalkDutyTimesQuery;
import cn.topevery.garden.entity.vo.DingtalkDutyTimesMessageVO;
import cn.topevery.garden.entity.vo.DingtalkDutyTimesVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 
 *
 * @author code-generate
 * @date 2021-09-02
 */
@Service
public class DingtalkDutyTimesLogic extends BaseLogic<DingtalkDutyTimes> {
    @Autowired
    DingtalkDutyTimesDao dingtalkDutyTimesDao;

    @Override
    public BaseEntityDao<DingtalkDutyTimes, Integer> getDao() {
        return dingtalkDutyTimesDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<DingtalkDutyTimesVO> listPage(DingtalkDutyTimesQuery query) {
        return dingtalkDutyTimesDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        dingtalkDutyTimesDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param dingtalkDutyTimes 实体
     */
    public void saveOrUpdate(String userId, DingtalkDutyTimes dingtalkDutyTimes){
        dingtalkDutyTimesDao.saveOrUpdate(userId,dingtalkDutyTimes);
    }

    public void truncate() {
        dingtalkDutyTimesDao.truncate();
    }

    public List<DingtalkDutyTimesMessageVO> selectDutyTimesById(Long shiftId) {
        return dingtalkDutyTimesDao.selectDutyTimesById(shiftId);
    }
}
